﻿<%@ Page Title="Tin lưu trữ" Language="vb" AutoEventWireup="false" MasterPageFile="~/Master/InSite.Master" CodeBehind="NewRecycle.aspx.vb" Inherits="Core.NewRecycle" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<style type="text/css" media="all">
		@import url(/static/inSite/css/redmond.datepick.css);
		.datepick-trigger{cursor:pointer;margin-bottom: -5px;}
</style>
<script src="/static/inSite/js/jquery.datepick.js" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        $('#ctl00_ContentPlaceHolder1_txtStartDate').datepick({ showOnFocus: false, showTrigger: '<img src="/static/inSite/images/date.png" alt="..."></img>' });
        $('#ctl00_ContentPlaceHolder1_txtEndDate').datepick({ showOnFocus: false, showTrigger: '<img src="/static/inSite/images/date.png" alt="..."></img>' });
    });
</script>
<script language="javascript" type="text/javascript">
    $("#clickme").click(function () {
        alert(1);
        $("#searchForm").show("slow");
        //$("div").show("fast");
    });

    $("#spanHide").click(function () {
        $("#searchForm").hide(100);
    });
    function showF() {
        $("#fieldForm").css("width", "350px");
        $("#fieldForm").css("padding", "15px");
        $("#fieldForm").css("border", "1px solid #0095FD");

        $("#searchForm").show("fast");
        $("#spanShow").hide(100);
        $("#spanHide").show("fast");
    }

    function hideF() {
        $("#searchForm").hide(100);
        $("#spanHide").hide(100);
        $("#spanShow").show("fast");

        $("#fieldForm").css("width", "0px");
        $("#fieldForm").css("padding", "0px");
        $("#fieldForm").css("border", "none");
    }
</script>
<fieldset style="width:0px;margin: 0 auto;padding:0px;border:none;margin-left: 260px;" id="fieldForm">
    <legend>
        <img src="/static/inSite/images/edit_add.png" id="spanShow" onclick="showF();" style="cursor:pointer;" />
        <img src="/static/inSite/images/edit_remove.png" id="spanHide" style="display:none;cursor:pointer;" onclick="hideF();" />
    </legend>
    <div id="searchForm" style="display:none;">
        <table width="100%">
            <tr>
                <td style="width:110px; color: #666666;">
                    Tiêu đề tin:
                </td>
                <td>
                    <asp:TextBox ID="txtTitle" class="mediumfield" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="width:110px; color: #666666;">
                    Danh mục:
                </td>
                <td>
                    <asp:DropDownList ID="cbxMenu" runat="server" CssClass="centerCbx" Visible="true"></asp:DropDownList>
                </td>
            </tr>
           <tr>
                <td style="width:110px; color: #666666;">
                    Từ ngày:
                </td>
                <td>
                    <asp:TextBox ID="txtStartDate" class="smallfield" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="width:110px; color: #666666;">
                    Đến ngày:
                </td>
                <td>
                    <asp:TextBox ID="txtEndDate" class="smallfield" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="width:110px; color: #666666;">
                    Trạng thái:
                </td>
                <td>
                    <asp:DropDownList ID="cbxStatus" runat="server" CssClass="centerCbx" Width="218px"></asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:Button ID="btnSearch" runat="server" Text="Tìm kiếm" class="button" Height="26px" />
                </td>
            </tr>
        </table>
    </div>
    
</fieldset>
<br />
    <asp:Label ID="lbSort" runat="server" Text="ASC" Visible="false"></asp:Label>
    <asp:Label ID="lbSql" runat="server" Text="" Visible="false"></asp:Label>
<fieldset>
    <legend>Danh sách sản phẩm</legend>
    <asp:SqlDataSource ID="dsSource" runat="server"></asp:SqlDataSource>
    <asp:GridView runat="server" ID="gridMenu" AutoGenerateColumns="false" DataSourceID="dsSource" 
        class="tblMain" DataKeyNames="SubCatID" BorderWidth="0" Width="100%" ShowHeader="false">
        <Columns>
            <asp:TemplateField ItemStyle-BackColor="#9097A9" >
                <ItemStyle Width="100%" />
                <ItemTemplate>
                    <asp:Label Visible="false" runat="server" ID="lbl_ID" Text='<%#Eval("SubCatID") %>'></asp:Label>
                    <asp:Label Visible="true" runat="server" ID="lbl_CatName" Text='<%#showBreadCrumbs(Eval("CatPageName"), Eval("SubCatPageName")) %>'></asp:Label>
                    <asp:Label Visible="false" runat="server" ID="lb_GridID" Text='<%#Container.DataItemIndex + 2 %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField ItemStyle-BackColor="#9097A9">
                <ItemTemplate>  
                    </td></tr>  
                    <tr>  
                <td colspan="100%" style="padding: 0px;border:1px solid #9097a9;"><div id="div<%#(Container.DataItemIndex + 2).ToString("00") %>" class="tblChild">  
                    <asp:GridView ID="gridChild" runat="server" class="tblMain" 
                        AutoGenerateColumns="False" GridLines="Horizontal" AllowPaging="True" 
                        PageSize="10" AllowSorting="False" DataKeyNames="NewID" Width="100%"
                        OnRowEditing="gridChild_RowEditing" 
                        OnRowCancelingEdit="gridChild_RowCancelingEdit" 
                        OnPageIndexChanging="gridChild_PageIndexChanging"
                        OnSorting="gridChild_Sorting"
                        OnRowCreated="gridChild_RowCreated"
                        OnRowDataBound="gridChild_OnRowDataBound"
                        OnRowUpdating="gridChild_OnRowUpdating"
                        OnRowDeleting="gridChild_OnRowDeleting"
                        OnRowCommand="gridChild_OnRowCommand"
                        >
                        <EmptyDataTemplate>
                            <asp:Label ID="lblEmptySearch" runat="server" ForeColor="Red">Không tìm thấy tin bài phù hợp</asp:Label>
                        </EmptyDataTemplate>
                        <Columns>
                            <asp:TemplateField HeaderText="No.">
                                <ItemTemplate>
                                    <asp:Label Visible="false" runat="server" ID="lbl_ID" Text='<%#Eval("NewID") %>'></asp:Label>
                                    <asp:Label Visible="false" runat="server" ID="lbl_Name" Text='<%#Eval("NewTitle") %>'></asp:Label>
                                    <asp:Label Visible="false" runat="server" ID="lblSubCatID" Text='<%#Eval("SubCatID") %>'></asp:Label>
                                    <asp:Label Visible="true" runat="server" ID="lblNo" Text='<%#Container.DataItemIndex + 1 %>'></asp:Label>
                                    <asp:Label Visible="false" runat="server" ID="lbStt" Text='<%#Eval("NewStt") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle Width="30px" HorizontalAlign="Left" ForeColor="Black" />
                                <ItemStyle Width="30px" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Tiêu đề tin" SortExpression="NewTitle">
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButton1" runat="server" Text='<%#Eval("NewTitle")%>' PostBackUrl='<%#formatLink(Eval("NewID")) %>'></asp:LinkButton>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox runat="server" ID="NewTitle" Text='<%#formatUnicode(Eval("NewTitle")) %>' Width="90%"></asp:TextBox>
                                </EditItemTemplate>
                                <HeaderStyle HorizontalAlign="Left"  ForeColor="Black"/>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Ngày viết">
                                <ItemTemplate>
                                     <asp:Label ID="lbTime" runat="server" Text='<%#formatTime(Eval("NewDate")) %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle Width="130px" HorizontalAlign="Left" ForeColor="Black" />
                                <ItemStyle Width="130px" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Trạng thái">
                                <ItemTemplate>
                                    <asp:Label ID="lblStt" runat="server" Text='<%#getColorStt(Eval("NewStt")) %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:DropDownList ID="ddlStt" runat="server"></asp:DropDownList>
                                </EditItemTemplate>
                                <HeaderStyle Width="60px" HorizontalAlign="Left"  ForeColor="Black"/>
                                <ItemStyle Width="60px" />
                            </asp:TemplateField>
                             <asp:TemplateField HeaderText="Phục hồi" ShowHeader="False" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="100"> 
                                <ItemTemplate> 
                                    <asp:ImageButton ID="ImgButRecover" runat="server" CausesValidation="False" CommandArgument='<%#buildArgument(Eval("NewID"), Eval("NewTitle")) %>' CommandName="Recover" ImageUrl="~/static/inSite/images/recover.png" CssClass="noneCSS"/>
                                </ItemTemplate> 
                                <HeaderStyle HorizontalAlign="Center" ForeColor="Black"></HeaderStyle>
                                <ItemStyle Width="65px" HorizontalAlign="Center"></ItemStyle>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Xóa" ShowHeader="False" HeaderStyle-HorizontalAlign="Right" ItemStyle-Width="20"> 
                                <ItemTemplate> 
                                    <asp:ImageButton ID="butDelete" runat="server" CausesValidation="False" CommandName="Delete" ImageUrl="~/static/inSite/images/recycle.png" CssClass="noneCSS" OnClientClick="return confirm('Bạn có chắc chắn muốn xóa <Tin Bài> này? \n\nChú ý: Tin Bài xóa tại đây sẽ không thể phục hồi.');"/>
                                </ItemTemplate> 
                                <HeaderStyle HorizontalAlign="Center" ForeColor="Black"></HeaderStyle>
                                <ItemStyle Width="20px" HorizontalAlign="Right"></ItemStyle>
                            </asp:TemplateField> 
                        </Columns>
                        <PagerStyle HorizontalAlign="Center" CssClass="subPageFunction" />
                    </asp:GridView>
                </div></td></tr> 
                <tr><td style="background-color:#e8e8e8;"></td></tr> 
                </ItemTemplate>  
            </asp:TemplateField>  
        </Columns>
    </asp:GridView>
</fieldset>

</asp:Content>
